﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Framework.Data.Core;
using Framework.Data.Security;
using AppTestWPF.BusinessObjects;

namespace AppTestWPF
{
    public partial class Form1 : Form
    {
        EntityCollection<object, IBaseEntity> persons;
        

        public Form1()
        {
            InitializeComponent();
            this.LoadData();
        }

        private void LoadData()
        {

            if (SecurityManager.Instance.OpenConnection("BOIMER01", "vbdev03", "DEV01"))
            {
                persons = (EntityCollection<object, IBaseEntity>)Personne.GetEntityList(typeof(Personne));

                foreach (Personne p in persons.Values)
                {
                    this.lstPerson.Items.Add(p.Name);
                }
            }
        }
    }
}
